package com.jack.userservice.listener;

import com.alibaba.nacos.client.naming.NacosNamingService;
import org.springframework.boot.web.context.WebServerInitializedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class JackListener implements ApplicationListener<WebServerInitializedEvent> {
    // Spring Boot源码启动的时候，如果发布了该事件的类型WebServerInitializedEvent，那么就会自动回调到onApplicationEvent
    @Override
    public void onApplicationEvent(WebServerInitializedEvent event) {
        System.out.println("hah");
//        new NacosNamingService().registerInstance();
    }
}
